package com.sdkx.app.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.sdkx.app.activitys.MainActivity;

public class BaseFragment extends Fragment {

 protected void startFragment(Class<? extends Fragment> classobj){
     Activity act  = getActivity();
     if(act != null) {
         ((MainActivity) act).startFragment(classobj);
     }
 }

 protected  void startFragment(Class<? extends Fragment> classobj,Bundle bundle){
     Activity act  = getActivity();
     if(act != null) {
         ((MainActivity) act).startFragment(classobj,bundle);
     }
 }
 protected void goBack(){
     Activity act = getActivity();
     if(act != null){
         ((MainActivity)act).popBack();
     }
 }

 protected void backToFragment(Class<? extends Fragment> classobj){
     Activity act = getActivity();
     if(act != null){
         ((MainActivity)act).popToFragment(classobj);
     }
 }
}
